Repository navigation
Fix heap accounting for sealed TsFile resources - #19347
Open
JackieTien97 wants to merge 1 commit into
Open
JackieTien97 wants to merge 1 commit into
JackieTien97 wants to merge 1 commit into
Conversation
Estimate resource metadata and device indexes separately. Track the charge for each registered file so metadata changes, degradation, and removal update the time-index budget consistently.
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #19347 +/- ##
==========================================
Coverage 49.44% 49.44%
Complexity 718 718
==========================================
Files 5656 5656
Lines 418222 418390 +168
Branches 55296 55345 +49
==========================================
+ Hits 206769 206886 +117
- Misses 211453 211504 +51 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Description
The DataNode uses the estimated heap of sealed TsFile resources to decide when to degrade device indexes. The previous estimate omitted the file path, per-resource locks and atomic objects, and lazily created modification-file handles. It also cached the first device-index estimate across changes. On removal, the manager recalculated the charge, so a resource whose progress index had grown could release bytes belonging to another file.
TsFileResourcenow measures resident metadata separately from the current time index.ArrayDeviceTimeIndexincludes the device map's buckets and entries alongside the device IDs and time arrays.TsFileResourceManagerrecords each registration's charge, applies changes as deltas, and releases the remaining balance on removal. Metadata-only changes reuse the registered index size. Compaction accounts for the device index it actually caches, and LOAD accounts for a shared file handle once.Example
For a sealed resource with a 54-character file path on JDK 17.0.5 with compressed references, creating the exclusive mods handle previously left the estimate at 272 bytes.
The measurements count each owned object once. The budget uses estimates for strings and hash-table capacity.
Verification
with-zh-localeprofile on JDK 17.